{% load static %}
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>PyGeek | 登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="{% static 'adminlte/bower_components/bootstrap/dist/css/bootstrap.min.css' %}">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="{% static 'adminlte/bower_components/font-awesome/css/font-awesome.min.css' %}">
    <!-- Ionicons -->
    <link rel="stylesheet" href="{% static 'adminlte/bower_components/Ionicons/css/ionicons.min.css' %}">
    <!-- Theme style -->
    <link rel="stylesheet" href="{% static 'adminlte/dist/css/AdminLTE.min.css' %}">
    <!-- iCheck -->
    <link rel="stylesheet" href="{% static 'adminlte/plugins/iCheck/square/blue.css' %}">


</head>
<body class="hold-transition login-page" style="background-image: url(https://s2.loli.net/2022/01/04/tDLbflqXz1srwv2.jpg);">
<div class="login-box"  style="width: 210px; height: 500px; margin: auto;">
    <!-- <div class="login-logo">
        <a href=""><b>Ali</b>CRM</a>
    </div> -->
    <!-- /.login-logo -->
    <div class="login-box-body" style="text-align: center;">
        <p class="login-box-msg" style="font-size: larger; font-family: 'Courier New', Courier, monospace; margin-top: 100px;"><b>欢迎PyGeek成员登录</b></p>

        <form action="{% url 'login' %}" method="post">
            {% csrf_token %}
            <div class="form-group has-feedback">
                <input type="text" class="form-control" placeholder="用户名" name="username" style="margin: 10px  0; height: 35px; width: 200px; font-size: medium;">
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
                <span class="has-error" style="color:black">{{ form_obj.username.errors.0 }}</span>
                <span class="has-error" style="color:black">{{ form_obj.username.errors.1 }}</span>
            </div>
            <div class="form-group has-feedback">
                <input type="password" class="form-control" placeholder="密码" name="password" style="margin: 10px  0; height: 35px; width: 200px; font-size: medium;">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                <span class="has-error" style="color:black">{{ form_obj.password.errors.0 }}</span>
                <span class="has-error" style="color:black">{{ form_obj.password.errors.1 }}</span>
            </div>
            <div class="row">
                <div class="col-sm-7">
                    <div class="form-group has-feedback">
                        <input type="text" class="form-control" placeholder="验证码" name="authcode" style="margin: 10px  0; height: 35px; width: 200px; font-size: medium;">
                        <span class="glyphicon glyphicon-barcode form-control-feedback"></span>
                        <span class="has-error" style="color:black">{{ form_obj.authcode.errors.0 }}</span>
                        <span class="has-error" style="color:black">{{ form_obj.authcode.errors.1 }}</span>
                    </div>
                </div>
                <div class="col-sm-4">
                    <img id="authImg" src="{% url 'get_auth_img' %}" alt="验证码" style="width: 200px; margin: 30px 0;">
                </div>
            
                
            </div>
            <div class="row">
                <!-- /.col -->
                <div class="col-xs-4" style="height: 30px;">
                    <button id="loginBtn" class="btn btn-primary btn-block btn-flat" type="submit" style="width: 200px;  
                    height: 40px;
                    padding:8px;  
                    background-color: #428bca;  
                    border-color: #357ebd;  
                    color: #fff;  
                    -moz-border-radius: 10px;  
                    -webkit-border-radius: 10px;  
                    border-radius: 10px; /* future proofing */  
                    -khtml-border-radius: 10px; /* for old Konqueror browsers */  
                    text-align: center;  
                    vertical-align: middle;  
                    border: 1px solid transparent;  
                    font-weight: 900;  
                    font-size:125%;  
                    font-family: 'Courier New', Courier, monospace;">登录</button>
                </div>
                <!-- /.col -->
            </div>
        </form>

        
        <div class="social-auth-links text-center">
            <br>
            <p><b>-- 或 --</b></p>
        </div>
        <!-- /.social-auth-links -->

        <a href="{% url 'register' %}" class="text-center" style="text-decoration:none;
        font-family: '楷体';
        color: #01037e;
        font-size: 18px;"><b>无账号，点我现在去注册！</b></a>

    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 3 -->
<!-- <script src="{% static 'jquery/jquery-3.4.1.js' %}"></script> -->
<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<!-- <script src="{% static 'adminlte/bower_components/bootstrap/dist/js/bootstrap.min.js' %}"></script> -->
<!-- <script src="https://cdn.bootcdn.net/ajax/libs/twitter-bootstrap/4.6.1/js/bootstrap.min.js"></script> -->
<!-- iCheck -->
<!-- <script src="{% static 'adminlte/plugins/iCheck/icheck.min.js' %}"></script> -->
<script src="https://cdn.bootcdn.net/ajax/libs/iCheck/1.0.3/icheck.min.js"></script>
<script>
    $(function () {
        $('input').iCheck({
            checkboxClass: 'icheckbox_square-blue',
            radioClass: 'iradio_square-blue',
            increaseArea: '20%' /* optional */
        });
    });

    // 验证码刷新
    $("#authImg").on("click", function () {
        $("#authImg")[0].src += "?" // 点击事件刷新验证码图片
    })
</script>
</body>
</html>

